package com.springboot.web;/**
 * Created by Administrator on 2017/3/10.
 */

import com.springboot.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * IndexController
 *
 * @author jlicc
 * @create 2017-03-10-17:31
 **/
@Controller
public class IndexController {
    @RequestMapping("/index")
    public String index(ModelMap map){
        map.addAttribute("host", "http://blog.didispace.com");
        return "index";
    }

    @RequestMapping("/json")
    public String json() throws MyException {
        throw new MyException("发生错误2");
    }

}
